home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / ab20_archive / utilities / emulators / unixlib.lzh / garbage.c < prev    next >
C/C++ Source or Header  |  1991-10-19  |  1KB  |  59 lines

  1. /* This file contains some miscelaneous functions that wouldn't fit in other
  2.  * files. So it is a mess ...        Cthulu
  3.  */
  4.  
  5.  
  6. #include <sys/times.h>
  7. #include <exec/tasks.h>
  8.  
  9. char *malloc();
  10.  
  11. /* change what options .... */
  12. int fcntl(int fd, int cmd, int arg) { return 0; }
  13.  
  14.  
  15. /*  Networks use the same format as Motorola, so no byte-swapping needed.
  16.  *  For Intel this function should be implemented.  *grin*
  17.  */
  18. unsigned short htons(int integer) { return integer; }
  19.  
  20.  
  21. int getpid() { 
  22.     extern struct Task *FindTask(char *);
  23.     return (int)FindTask(0L);  /* anyone got a better suggestion ?? */
  24. }
  25.  
  26. void times(t)
  27.     register struct tms *t;
  28. {
  29.     extern time_t time(time_t *_timer);
  30.  
  31.     t->tms_utime = 0;        /* user-time */
  32.     t->tms_stime = time(0);    /* system-time */
  33.     return;
  34. }
  35.  
  36. /*
  37.  * block zero
  38.  */
  39.  
  40. void
  41. bzero (b, length)
  42.      register char *b;
  43.      register int length;
  44. {
  45. #ifdef AZTEC_C
  46.    setmem(b, length, '\0');
  47. #else
  48.    memset(b,'\0',length);
  49. #endif
  50. }
  51.  
  52. void srandom(unsigned int seed) {
  53.     srand(seed);
  54. }
  55.  
  56. void random() {
  57.     rand();
  58. }
  59.